package com.lz.football.module.guess
{
	import com.common.utils.Reflection;
	import com.global.GlobalDef;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import lz.controls.core.UIComponent;

	/**
	 *球队详情面板 
	 * @author lake
	 * 
	 */	
	public class TeamDetailPanel extends UIComponent implements IComponent
	{
		/**
		 * 关闭
		 */		
		private var closeBtn 			:SimpleButton;
		/**
		 *详情文本 
		 */		
		private var txtDetail			:TextField;
		/**
		 *data 
		 */		
		private var _data			:*;
		
		public function TeamDetailPanel()
		{
			super();
		}
		/**
		 *获取设置数据 
		 * @param value
		 * 
		 */		
		public function set data(value:*):void
		{
			_data = value;
			if(_data == null)
			{
				return;
			}
			txtDetail.htmlText = "" + _data;
		}
		public function get data():*
		{
			return _data;
		}
		/**
		 *初始化 
		 * @param view
		 */		
		public function initUI(view:Object=null):void
		{
			_symbolSkin = Reflection.createInstance("com.lz.res.fbLottery.TeamDetailSKin");
			this.addChild(_symbolSkin);
			closeBtn = Reflection.createInstance("com.liangzhong.ui.closeBtn");
			_symbolSkin.addChild(closeBtn);
			closeBtn.x = 483;
			closeBtn.y = 3;
			_symbolSkin.x = (GlobalDef.GameWidth - _symbolSkin.width)/2;
			_symbolSkin.y = (GlobalDef.GameHeight - _symbolSkin.height)/2 + 30 ;
			txtDetail = _symbolSkin.txtDetail;
			addEvtListener();
		}
		/**
		 *添加事件 
		 */		
		public function addEvtListener():void
		{
			closeBtn.addEventListener(MouseEvent.CLICK,closeHandler);
		}
		/**
		 *关闭 
		 * @param e
		 * 
		 */		
		private function closeHandler(e :MouseEvent):void
		{
			if(this.parent)
			{
				this.parent.removeChild(this);
			}
		}
		/**
		 *删除事件 
		 */		
		public function removeEvtListener():void
		{
			closeBtn.removeEventListener(MouseEvent.CLICK,closeHandler);
		}
		/**
		 *销毁 
		 */		
		public function destroyView():void
		{
			if(this.parent)
			{
				this.parent.removeChild(this);
			}
			removeEvtListener();
		}
	}
}